﻿@model IEnumerable<WeddingEventManagementApp.Models.ClientDetailInvoice_VM>

<h5>Active Invoices</h5>

<table cellspacing="0" cellpadding="0" class="table">
<thead>
    <tr>
        <th>Event Title</th>
        <th>Due Date</th>
        <th>Outstanding Balance</th>
        <th></th>
        <th></th>
        <th></th>
    </tr>
</thead>
<tbody>
    @foreach (var inv in Model)
    {
        <tr>
            <td>@inv.EventName</td>
            <td>@inv.DueDate.ToShortDateString()</td>
            <td id="inv-total-@inv.InvoiceID">@inv.OutstandingBalance.ToString("c")</td>
            <td>@Html.ActionLink("View", "Index", "Invoice", new { id = inv.InvoiceID }, new { @class = "k-button k-button-icontext" })</td>
            <td>
                <a  data-reveal-id="add-payment" 
                href="#" 
                data-client-id="@inv.ClientID"
                data-invoice-id="@inv.InvoiceID"
                data-event-name="@inv.EventName"
                class="k-button k-button-icontext addPaymentBtn">Add Payment
                </a>
            </td>
            <td>
                <a  data-reveal-id="view-payments"
                href="#"
                data-invoice-id="@inv.InvoiceID"
                data-event-name="@inv.EventName"
                class="k-button k-button-icontext viewPaymentsBtn">View Payments
                </a>
            </td>
        </tr>
    }
</tbody>
</table>